<template>
	<view>
		<view style="height: 20rpx;"></view>
		<mescroll-body ref="mescrollRef" :height="windowHeight+'rpx'" @init="mescrollInit" @down="downCallback"
			@up="upCallback" :up="upOption" :down="downOption">
			<view class="list-public" v-for="(item,index) in list" :key="index">
				<view class="display-a">
					<view class="frame-left"></view>
					<view class="name">{{item.logName}}{{item.logVersion}}</view>
				</view>
				<view class="padding-bottom_20rpx p-bo color_999999 font-size_26rpx">更新时间: {{item.releaseTime}}</view>
				<view class="padding-top_20rpx" v-if="item.logUpdate">
					<rich-parser :html="item.logUpdate" domain="https://6874-html-foe72-1259071903.tcb.qcloud.la" lazy-load
						ref="article" selectable show-with-animation use-anchor>
					</rich-parser>
				</view>
			</view>
		</mescroll-body>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// 下拉配置项
				downOption: {
					auto: false
				},
				// 上拉配置项
				upOption: {
					auto: false
				},
				
				list: [],
				
				windowHeight: '',
			}
		},
		
		onLoad() {
			uni.getSystemInfo({
				success: (res) => {
					this.windowHeight = res.windowHeight * 2 - 24;
				}
			});
		},
		
		onShow() {
			this.$nextTick(() => {
				this.mescroll.resetUpScroll();
			});
		},
		
		methods: {
			
			async upCallback(scroll) {
				const result = await this.$http.post({
					url: this.$api.logList,
					data: {
						page: scroll.num,
						limit: 10
					}
				});
				if (result.code == 2000) {
					this.mescroll.endByPage(result.data.list.length, result.data.count);
					if (scroll.num == 1) this.list = [];
					this.list = this.list.concat(result.data.list);
				}
			},
			
		}
	}
</script>

<style lang="scss">
	
	.name {
		font-size: 30rpx;
		font-weight: bold;
		margin-bottom: 14rpx;
	}
	
	.frame-left {
		width: 6rpx;
		height: 28rpx;
		background-color: #0C91F3;
		border-radius: 10rpx;
		margin-right: 16rpx;
		margin-bottom: 14rpx;
	}
	
</style>
